Skip to content

Conversation

@BioPhoton
Copy link
Collaborator

@BioPhoton BioPhoton commented Jan 16, 2026

Related: #1197

This PR includes:

  • adding NodeJSProfiler class
  • implemented performanceObserver for NodeJSProfiler
  • revamp PerformanceObserverSink - add getStatus for better testing, more robust and memory friendly buffer logic

Note

Introduces a Node.js profiling runtime with buffered performance entry handling and richer diagnostics.

  • Adds NodejsProfiler that wraps Profiler with a PerformanceObserverSink, manages WAL/sink lifecycle, runtime enable/disable, state transitions, flush(), and stats exposure (with optional debug transition markers via CP_PROFILER_DEBUG)
  • Rewrites PerformanceObserverSink with safe bounded queue (maxQueueSize), proactive flushing (flushThreshold), buffered capture, encode error handling (optional debug marks), getStats(), and validateFlushThreshold
  • Updates test/mocks: MockSink/MockTraceEventFileSink (Recoverable), new PerformanceObserver test utils, comprehensive unit/integration tests for sink and profilers
  • Adds profiler documentation covering setup, API, environment flags, and Node.js integration

Written by Cursor Bugbot for commit ac4a1fc. This will update automatically on new commits. Configure here.

- Add explanation that sink determines output format (DevTools TraceEvent, OpenTelemetry, etc.)
- Improve documentation clarity for flexible serialization capabilities
- Fix duplicate imports in profiler unit test
- Replace method implementations with vi.fn() spy functions
- Add vi import from vitest
- Enables better testing with call tracking and assertions
@github-actions github-actions bot added 📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🧩 utils labels Jan 16, 2026
@nx-cloud
Copy link

nx-cloud bot commented Jan 16, 2026

View your CI Pipeline Execution ↗ for commit ac4a1fc

Command Status Duration Result
nx run ci:code-pushup -- merge-diffs --files=/h... ✅ Succeeded 5s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 1m 32s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 13m 6s View ↗
nx run-many -t unit-test,int-test ✅ Succeeded 8s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-26 22:11:18 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 16, 2026

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1219

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1219

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1219

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1219

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1219

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1219

@code-pushup/axe-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/axe-plugin@1219

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1219

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1219

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1219

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1219

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1219

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1219

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1219

commit: ac4a1fc

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit 25388bf with previous commit ea27cdc.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Documentation 🔴 42 🟡 51 ↑ +8.5
Performance 🔴 29 🔴 35 ↑ +6.6
Code coverage 🟢 92 🟢 92 ↓ −0.1
Bug prevention 🟡 75 🟡 75 ↓ −0.1
Axe Accessibility 🟡 88 🟡 88 ↓ −0.1
Code style 🟢 100 🟢 100
Security 🔴 47 🔴 47
Updates 🟡 78 🟡 78
Type Safety 🟡 67 🟡 67
Miscellaneous 🟡 67 🟡 67
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟢 92 🟢 92
👍 2 groups improved, 👎 1 group regressed, 👍 11 audits improved, 👎 2 audits regressed, 13 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
JSDocs coverage Documentation coverage 🔴 42 🟡 51 ↑ +8.5
Lighthouse Performance 🔴 29 🔴 35 ↑ +6.6
Code coverage Code coverage metrics 🟢 92 🟢 92 ↓ −0.1

31 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
JSDocs coverage Properties coverage 🟥 30 undocumented properties 🟥 27 undocumented properties ↓ −10 %
Lighthouse First Contentful Paint 🟥 3.9 s 🟥 3.1 s ↓ −21.7 %
Lighthouse Speed Index 🟥 9.3 s 🟥 7.0 s ↓ −24.8 %
JSDocs coverage Methods coverage 🟨 13 undocumented methods 🟨 9 undocumented methods ↓ −30.8 %
JSDocs coverage Classes coverage 🟥 6 undocumented classes 🟨 5 undocumented classes ↓ −16.7 %
Lighthouse Total Blocking Time 🟥 7,300 ms 🟥 1,940 ms ↓ −73.5 %
Lighthouse Time to Interactive 🟥 17.7 s 🟥 13.7 s ↓ −22.7 %
JSDocs coverage Variables coverage 🟥 272 undocumented variables 🟥 272 undocumented variables  +0 %
JSDocs coverage Types coverage 🟥 272 undocumented types 🟥 271 undocumented types ↓ −0.4 %
JSDocs coverage Functions coverage 🟥 579 undocumented functions 🟥 579 undocumented functions  +0 %
Code coverage Line coverage 🟩 92.3 % 🟩 92.5 % ↑ +0.1 %
Code coverage Branch coverage 🟨 89 % 🟨 88.9 % ↓ −0.1 %
Code coverage Function coverage 🟩 94.1 % 🟩 94.1 % ↓ −0.1 %
Lighthouse Minimizes main-thread work 🟥 24.2 s 🟥 10.9 s ↓ −54.9 %
Lighthouse JavaScript execution time 🟥 9.6 s 🟥 4.3 s ↓ −55.3 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,098 KiB 🟩 Total size was 2,093 KiB ↓ −0.2 %
Lighthouse Metrics 🟩 100% 🟩 100% ↓ −22.7 %
Lighthouse Largest Contentful Paint 🟥 14.5 s 🟥 11.7 s ↓ −18.9 %
Lighthouse Max Potential First Input Delay 🟥 3,650 ms 🟥 1,150 ms ↓ −68.6 %
Lighthouse Server Backend Latencies 🟩 1,040 ms 🟩 600 ms ↓ −41.8 %
Lighthouse Uses efficient cache policy on static assets 🟨 31 resources found 🟨 31 resources found ↓ −0.1 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 125 KiB 🟥 Potential savings of 125 KiB ↑ +62.5 %
Lighthouse Reduce unused JavaScript 🟥 Potential savings of 226 KiB 🟥 Potential savings of 226 KiB ↑ +29.2 %
Lighthouse Initial server response time was short 🟩 Root document took 560 ms 🟩 Root document took 500 ms ↓ −9.7 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 88 KiB 🟥 Potential savings of 88 KiB ↑ +2.2 %
Lighthouse Network Round Trip Times 🟩 20 ms 🟩 10 ms ↓ −35.3 %

653 other audits are unchanged.

@BioPhoton BioPhoton marked this pull request as ready for review January 16, 2026 22:22
@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit 25388bf with previous commit ea27cdc.

💼 Project utils

🤨 Code PushUp report has both improvements and regressions.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Documentation 🔴 46 🟡 57 ↑ +11.1
Code coverage 🟢 95 🟢 95 ↓ −0.1

4 other categories are unchanged.

👍 1 group improved, 👎 1 group regressed, 👍 7 audits improved, 👎 2 audits regressed

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
JSDocs coverage Documentation coverage 🔴 46 🟡 57 ↑ +11.1
Code coverage Code coverage metrics 🟢 95 🟢 95 ↓ −0.1

13 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
JSDocs coverage Properties coverage 🟥 27 undocumented properties 🟥 24 undocumented properties ↓ −11.1 %
JSDocs coverage Classes coverage 🟨 3 undocumented classes 🟨 2 undocumented classes ↓ −33.3 %
JSDocs coverage Methods coverage 🟨 13 undocumented methods 🟨 9 undocumented methods ↓ −30.8 %
JSDocs coverage Variables coverage 🟥 49 undocumented variables 🟥 49 undocumented variables  +0 %
JSDocs coverage Types coverage 🟥 66 undocumented types 🟥 65 undocumented types ↓ −1.5 %
JSDocs coverage Functions coverage 🟥 241 undocumented functions 🟥 241 undocumented functions  +0 %
Code coverage Branch coverage 🟩 91.7 % 🟩 91.6 % ↓ −0.2 %
Code coverage Function coverage 🟩 95.7 % 🟩 95.6 % ↓ −0.1 %
Code coverage Line coverage 🟩 97.7 % 🟩 97.8 % ↑ +0.1 %

435 other audits are unchanged.


13 other projects are unchanged.

Co-authored-by: Hanna Skryl <80118140+hanna-skryl@users.noreply.github.com>
@BioPhoton BioPhoton requested a review from hanna-skryl January 18, 2026 17:41
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

# Conflicts:
#	packages/utils/src/lib/profiler/profiler.int.test.ts
#	packages/utils/src/lib/profiler/profiler.unit.test.ts
@BioPhoton BioPhoton requested a review from hanna-skryl January 26, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🧩 utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants